<?php
require_once 'Zend/Session/Namespace.php';
class ShowController extends Zend_Controller_Action {
	
	public function init() {
		$this->smarty = Zend_Registry::get ( 'smarty' );
		$this->config = Zend_Registry::get ( 'config' );
		$this->smarty->assign ( 'baseUrl', $this->_request->getBaseUrl () );
	
	}
	
	public function indexAction() {
		$boboNamespace = new Zend_Session_Namespace('bobo');
		$boboNamespace->bobo='gaobo';
		echo $boboNamespace->bobo;
		$page = $this->_request->getParam ( "page" );
		Zend_Loader::loadClass ( 'Custom_Controller_Plugin_PageUrl' );
		$Pagers = new Custom_Controller_Plugin_PageUrl ( 1000, 10, $page, "http://www.baidu.com?page=" );
		echo $Pagers->getPageMenu ();
		$this->smarty->assign ( 'title', 'default' );
		$this->smarty->display ( 'index/index.phtml' );
	}
	public function boboAction() {
		$this->smarty->assign ( 'title', 'default' );
		$this->smarty->display ( 'index/bobo.phtml' );
	}
	public function queryAction() {
		$db = Zend_Registry::get ( 'db' );
		$where = $db->quoteInto ( 'id = ?', 1 );
		$value = $db->quote ( array ('a', 'b', 'c' ) );
		$sql = 'select u.id , u.email  from oophp_user u';
		$result = $db->query ( $sql );
		$rows = $result->fetchAll ();
		echo count($rows);
		echo $value;
		echo $where;
		Zend_Debug::dump($where,"hi",true);
		Zend_Debug::dump($where,"bo",true);
		$this->smarty->assign ( 'title', 'default' );
		$this->smarty->display ( 'index/bobo.phtml' );
	}

}